﻿using Super.Admin.Entities;

namespace Super.Admin.IServices
{
    /// <summary>
    /// 角色服务接口类
    /// </summary>
    public interface IRoleService : IBaseService
    {
        /// <summary>
        /// 获取所有角色
        /// </summary>
        /// <returns>角色实体集合</returns>
        IReadOnlyCollection<RoleEntity> GetRoles();
        /// <summary>
        /// 获取角色列表
        /// </summary>
        /// <param name="roleName">角色名称</param>
        /// <param name="roleId">角色ID</param>
        /// <param name="isActive">状态</param>
        /// <param name="remark">备注</param>
        /// <param name="pageSize">一页数量</param>
        /// <param name="pageIndex">第几页</param>
        /// <param name="totalCount">总数</param>
        /// <returns>权限实体集合</returns>
        IReadOnlyCollection<RoleEntity> GetRoles(string roleName, int roleId, int isActive, string remark, string beginTime, string endTime, int pageSize, int pageIndex, out int totalCount);
        /// <summary>
        /// 获取权限通过角色ID
        /// </summary>
        /// <param name="roleId">需要权限的角色Id</param>
        /// <returns>权限Ids</returns>
        IReadOnlyCollection<int> GetPermissionsByRoleId(int roleId);
        /// <summary>
        /// 添加角色
        /// </summary>
        /// <param name="roleEntity"></param>
        void CreateRole(RoleEntity roleEntity, IEnumerable<int> permissionIds);
        /// <summary>
        /// 修改角色信息
        /// </summary>
        /// <param name="role">需要修改的角色</param>
        void UpdateRole(RoleEntity role, IEnumerable<int> permissionIds);
        /// <summary>
        /// 删除角色
        /// </summary>
        /// <param name="roleId">删除的角色id</param>
        void DeleteRole(int roleId);
    }
}
